# coding:utf-8
import tkinter as tk

class App:
    def __init__(self,master):
        frame=tk.Frame(master)
        frame.pack(side=tk.LEFT,padx=10,pady=10)

        self.hi_there=tk.Button(frame,text='打招呼',fg='black',bg='pink',command=self.say_hi)
        self.hi_there.pack()

    def say_hi(self):
        print("宝宝好呀,我是你的男朋友哈哈哈")
root=tk.Tk()
app=App(root)
root.mainloop()